const static = require('koa-static');
const path = require('path');

function serveStaticPlugin ({app, root}) {
    // 以当前根目录作为静态目录
    app.use(static(root));
    // 以public目录作为根目录
    app.use(static(path.resolve(root, 'public')))
}

module.exports = serveStaticPlugin;